package 线程的学习;

import static java.lang.Thread.currentThread;

public class JoinThread {
    public static void main(String [] args){
        MyThread5 MT=new MyThread5();
        MT.start();
        try{
            MT.join();//挂起主线程，等待客户线程执行，就是插队而已
        }catch(InterruptedException e){

        }
        for(int i=0;i<10;i++) System.out.println(currentThread().getName());
    }
}
class MyThread5 extends Thread{
    public void run(){
        for(int i=0;i<10;i++)
        System.out.println("我是线程："+currentThread().getName());
    }
}